package org.langcom.logic;



public class And extends LogicOperation {

	private static final long serialVersionUID = 3210454143436949447L;

	public And() {
		this("", ""); //$NON-NLS-1$ //$NON-NLS-2$
	}

	public And(String description, String detailedDescription) {
		super(description, detailedDescription);
	}

	public Or addOr(String description, String detailedDescription) {
		Or result = new Or(description,detailedDescription);
		children.add(result);
		return result;
	}
	
	public And add(Boolean expression, String description, String detailedDescription) {
		add(new LogicValue(description, detailedDescription, expression));
		return this;
	}

	@Override
	protected boolean compare(boolean arg1, boolean arg2) {
		return arg1 && arg2;
	}

	@Override
	public String toString() {
		return Messages.AndBrackets_0+" "+super.toString(); //$NON-NLS-1$
	}

}
